package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the materie database table.
 * 
 */
@Entity
@NamedQuery(name="Materie.findAll", query="SELECT m FROM Materie m")
public class Materie implements Serializable {
	
	

	/**
	 * 
	 */
	private static final long serialVersionUID = -7511138556385038954L;

	/**
	 * 
	 */
	
	@Id
	private int id;

	private String denumire;

	//bi-directional many-to-one association to Nota
	@OneToMany(mappedBy="materie")
	private List<Nota> notas;

	public Materie() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDenumire() {
		return this.denumire;
	}

	public void setDenumire(String denumire) {
		this.denumire = denumire;
	}

	public List<Nota> getNotas() {
		return this.notas;
	}

	public void setNotas(List<Nota> notas) {
		this.notas = notas;
	}

	public Nota addNota(Nota nota) {
		getNotas().add(nota);
		nota.setMaterie(this);

		return nota;
	}

	public Nota removeNota(Nota nota) {
		getNotas().remove(nota);
		nota.setMaterie(null);

		return nota;
	}

}